/**
 * Created by Colin3dmax on 16/12/26.
 */

'use strict';

import * as types from '../constants/action-types';

const initState = {
    near:[],
    hot:[],
    focus:[],
};

export default function reducer(state = initState, action) {
    switch (action.type) {
        case types.CLEAN_DONG_TAI:
            return initState;
        case types.RECEIVE_DONG_TAI_NEAR_RESULT:
            return Object.assign({},state,{near:action.near})
        case types.RECEIVE_DONG_TAI_HOT_RESULT:
            return Object.assign({},state,{hot:action.hot})
        case types.RECEIVE_DONG_TAI_FOCUS_RESULT:
            return Object.assign({},state,{focus:action.focus})
        default:
            return state;
    }
}
